﻿
'Description:计划分解信息维护接口
'Copyright (c) : 通力凯顿（北京）系统集成有限公司
'Writer:YangSJ
'create Date:2017-12-6
'Rewriter:
'Rewrite Date:
Imports BusinessRule.DTO
Public Interface uLMSPartPlanIBusiness
    ''' <summary>
    ''' yuxj20221126记录订单分解时的发动机件号信息
    ''' </summary>
    ''' <param name="dr"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function InsertOrReplaceMfgEngine(ByVal dr As DataRow) As Boolean
    ''' <summary>
    ''' 判断同件号，同工艺，同大阶段,同订单是否有批次已经插入
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CheckEngineHasInsert(ByVal QueryCondition As Dictionary(Of String, Object)) As Boolean
    ''' <summary>
    ''' 获取计划分解数据
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEnginePartPlanData(ByVal QueryCondition As Dictionary(Of String, Object)) As DataSet
    ''' 保存计划分解数据
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveEnginePartPlanData(ByVal QueryCondition As Dictionary(Of String, Object)) As Boolean
    Function FillSaveEnginePartPlan(ByVal QueryCondition As Dictionary(Of String, Object)) As Object()
    ''' 删除计划分解数据
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DeleteEnginePartPlanData(ByVal QueryCondition As Dictionary(Of String, Object)) As Boolean
    Function FillDeleteEnginePartPlan(ByVal para As Dictionary(Of String, Object)) As Object()
    ''' <summary>
    ''' Add by Yuxj20180521 执行更新操作
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateEnginePartPlanData(ByVal QueryCondition As Dictionary(Of String, Object)) As Boolean
    Function FillUpdateEnginePartPlan(ByVal QueryCondition As Dictionary(Of String, Object)) As Object()
    ''' <summary>
    ''' Add by Yuxj20180521,判断部件批次是否在Container表开立批次
    ''' </summary>
    ''' <param name="containerName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolEngineContainerExists(ByVal containerName As String) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180525 获取订单资料
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgData(ByVal mfgid As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180927
    ''' 更加订单分解表Id获取任务对于的工序列表
    ''' </summary>
    ''' <param name="EnginePartPlanId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetWorkFlowStepList(ByVal EnginePartPlanId As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180927
    ''' 更新发动机部件完工工序
    ''' </summary>
    ''' <param name="EnginePartPlanId"></param>
    ''' <param name="CompleteStepId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateCompleteStepid(ByVal EnginePartPlanId As String, ByVal CompleteStepId As String) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180927
    ''' 判断是否为完工工序
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolCompleteStep(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180927
    ''' 判断是否为工序的最后一道工步
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolLastStepinfo(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180927
    ''' 更新完工标记
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateUseComplete(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' Add by Yuxj20181113
    ''' 获取完工工序列表
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCompleteStep(ByVal pid As String, ByVal wfid As String) As DataTable
    Function GetCompleteStepID(ByVal pid As String, ByVal wfid As String) As String

    ''' <summary>
    ''' Modify by Yuxj20190301
    ''' 判断某大阶段订单是否有派工记录
    ''' </summary>
    ''' <param name="mfgId"></param>
    ''' <param name="wfsid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineStepStatus(ByVal mfgId As String, ByVal wfsid As String) As Boolean

    ''' <summary>
    ''' 获取同发动机件号，同部件，同工艺最近派工的工区
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetNearestWorkCenter(ByVal para As Dictionary(Of String, Object)) As String


    ''' <summary>
    ''' 存入大阶段的完工序
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateBigEPComplete(ByVal para As Dictionary(Of String, String)) As Boolean

#Region "订单维护发动机批次生成相关"
    ''' <summary>
    ''' 判断订单对应批次是否开立
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerHasExists(ByVal mfgid As String, ByRef Cid As String) As Boolean
    ''' <summary>
    ''' 获取件号对应的下一批次
    ''' </summary>
    ''' <param name="pname"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetCNamebyPName(ByVal pname As String) As String

    ''' <summary>
    ''' 创建模板
    ''' </summary>
    ''' <param name="mfgorderId"></param>
    ''' <param name="NewTemplet"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CreateMfgTemplet(ByVal mfgorderId As String, ByVal NewTemplet As String) As Boolean

    ''' <summary>
    ''' 修改模板名称
    ''' </summary>
    ''' <param name="NewTemplet"></param>
    ''' <param name="OldTemplet"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function updateMfgTemplet(ByVal NewTemplet As String, ByVal OldTemplet As String) As Boolean

    ''' <summary>
    ''' 批次信息更新
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateMfgContainer(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取节点下和发动机机型相同的件号
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function StepWorkFlowProductDT(ByVal para As Dictionary(Of String, Object)) As DataTable

    ''' <summary>
    ''' add by Yuxj20180420判断大阶段是否有工艺
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function StepWorkFlowDT(ByVal para As Dictionary(Of String, Object)) As DataTable

    ''' <summary>
    ''' 获取产品工艺
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetProductWorkFlow(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 获取大阶段周期
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetProductWorkFlowCycletime(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 判断模板信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgTemplet(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' 获取订单包含的批次
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetMfgContainer(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 判断订单是否已有分解
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolMfgOrderCreate(ByVal mfgid As String) As Boolean

    ''' <summary>
    ''' 删除模板记录
    ''' </summary>
    ''' <param name="Templet"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function deleteMfgTemplet(ByVal Templet As String) As Boolean

    ''' <summary>
    ''' 判断订单是否分解
    ''' </summary>
    ''' <param name="mfgOrderId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolIsSplit(ByVal mfgOrderId As String) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180515
    ''' 获取订单可以创建批次的缓存
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveMfgOrderSession(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' 判断是否为大阶段工艺 Add by Yuxj20180520
    ''' </summary>
    ''' <param name="workflowid"></param>
    ''' <param name="stepid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolStepidInWorkflow(ByVal workflowid, ByVal stepid) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180520 根据订单获取发动机号
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineNo(ByVal mfgid As String) As String

    ''' <summary>
    ''' 根据工艺获取BomId Add by Yuxj20180520
    ''' </summary>
    ''' <param name="workflowid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetBomListbyWorkflowid(ByVal workflowid As String) As DataTable

    ''' <summary>
    ''' 更改订单完成时间Add by Yuxj20180520
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateMfgFinishDate(ByVal para As Dictionary(Of String, Object)) As Boolean
    Function FillUpdateMfgFinishDate(ByVal para As Dictionary(Of String, Object)) As Object()
    ''' <summary>
    ''' Add by Yuxj20180525 根据条件做分解删除
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DeleteEnginePartPlan(ByVal para As Dictionary(Of String, Object)) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180605 获取发动机件号
    ''' </summary>
    ''' <param name="mfgid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineProductName(ByVal mfgid As String) As String

    ''' <summary>
    ''' 获取临时订单资料
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetTempOrderTable(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180703,判断试车工艺是否存在
    ''' </summary>
    ''' <param name="workflowcheck"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetWorkFlowCheck(ByVal workflowcheck As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180706
    ''' 获取发动机单一件号一级Bom
    ''' </summary>
    ''' <param name="FPName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineBomTable(ByVal FPName As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180706
    ''' 获取发动机整机件号列表
    ''' </summary>
    ''' <param name="FPName"></param>
    ''' <param name="dtRes"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineBomTree(ByVal FPName As String, ByRef dtRes As DataTable) As DataTable
    ''' <summary>
    ''' 获取所有发动机Bom列表 Add by Yuxj20180731
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineWholeBom(ByVal FPName As String) As DataTable
    ''' <summary>
    ''' 获取单个发动机Bom Add by Yuxj20180731
    ''' </summary>
    ''' <param name="dt"></param>
    ''' <param name="FPName"></param>
    ''' <param name="dtRes"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineBomList(ByVal dt As DataTable, ByVal FPName As String, ByRef dtRes As DataTable) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180829
    ''' 获取发动机的生产进度
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineProcessDT(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' Add by Yuxj20180829
    ''' 获取发动机各大阶段的生产进度 
    ''' </summary>
    ''' <param name="mfgId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetEngineStatus(ByVal mfgId As String) As DataTable

    ''' <summary>
    ''' Add by Yuxj20180829
    ''' 获取发动机任务单的信息
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerNoStatus(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' Add by Yuxj20190111
    ''' 增加对ProductWorkflowMapping的判断
    ''' </summary>
    ''' <param name="para"></param>
    ''' <param name="EngineProductId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CheckProductWorkflowMapping(ByVal para As Dictionary(Of String, Object), ByVal EngineProductId As String) As Boolean

    ''' <summary>
    ''' Add by Yuxj20190328
    ''' 增加模板工艺及件号判断
    ''' </summary>
    ''' <param name="templeteName"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function CheckTempletWorkFlow(ByVal templeteName As String) As DataTable

    ''' <summary>
    ''' 判断订单分解后记录是否包含所有大阶段
    ''' </summary>
    ''' <param name="pid"></param>
    ''' <param name="wfid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetSplitData(ByVal mfgid As String, ByVal pid As String, ByVal wfid As String) As Boolean
#End Region
End Interface
